Object-oriented programming (“OOP”) is based on objects that can contain data members and methods (also referred to as function members). For example, an object that represents a vehicle may contain data members for storing the brand and the model year of the vehicle and a method for printing the values of the data members of the vehicles. The data members and methods for an object are specified by a class definition. For example, the class definition for a Vehicle class may be represented by the following pseudocode:
class Vehicle{ str brand; int year; void new( ) {  brand = null;  year = 0; } public void displayInfo( ) {  print (brand);  print (year) }
This class definition includes two methods: new and displayInfo. The new method is a constructor that is invoked to initialize a Vehicle object when the Vehicle object is instantiated (i.e., created). A Vehicle object identified by the variable V may be instantiated and the data members and methods may be accessed as represented by the following pseudocode:
Vehicle V = new Vehicle( );V.year = 2016;V.model = “Ford”;V.displayInfo( );nextyear = V.year + 1;
OOP also allows one class to inherit the data members and methods of another class. For example, there are many different types or kinds of vehicles such as cars, trucks, and motorcycles. The vehicle types have some attributes in common and some attributes that are specific to the vehicle type. The common attributes may be brand and year. The car-specific attributes may include whether the car is a convertible and has a sun roof, and the truck-specific attributes may include maximum payload and maximum towing capacity. Although separate classes can be defined for each vehicle type, each class defining data members for the common attributes along with data members for the vehicle type-specific attributes, OOP inheritance allows the common attributes to be defined once and then inherited by the vehicle type-specific classes. The Vehicle class defines the data members and methods that are common to all vehicles. The inheritance of the Vehicle class by a Car class, a subclass of the Vehicle class, is represented by the following pseudocode:
class Car : Vehicle{ Boolean convertible; public void new( ) {  super( );  convertible = true; } public void displayInfo ( ) {  super( );  print (convertible); }}A Car object may be instantiated and accessed as represented by the following pseudocode:
Car C = new Car( );C.year = 2016;C.model = “Ford”;C.convertible = false;C.displayInfo( );The print method will print the following:
2016Fordhard top
Developers of application programs, such as customer relationship management (“CRM”) systems or enterprise resource planning (“ERP”) systems, allow users of the application programs (e.g., organizations that license the application programs) to customize the application programs to meet their needs. For example, an application program may include the Vehicle class, and a user may define the Car class, which inherits the Vehicle class, to perform some car-specific processing.
In some cases, a user would like to add a new data member that is common to all vehicles, such as color of the vehicle. The user could customize the application program by modifying the Vehicle class to add the color data member and modifying the application program to access the color data member. The user would then need to recompile the application program including the source code of the modified Vehicle class. This requires that the developer provide the source code to the user, which the developer may not want to do. Even if the developer did provide the source code to the user, the modifying of the source code of the Vehicle class by the user would present maintenance problems each time the developer releases a modified version of the Vehicle class. In such a case, the user would need to reapply the customizations to the application program. As an alternative to modifying the Vehicle class, the user could modify each class that inherits the Vehicle class, such as a Car class and a Truck class, to add the color data member. As another alternative, the user could create, for each subclass that inherits from the Vehicle class, a class inherits that subclass and includes the color data member. Although these alternatives do not require having access to and recompiling the source code of the Vehicle class, the alternatives result in duplication of source code for each class that inherits from the Vehicle class, which is error-prone and increases the cost of maintenance.